package org.rana.example.annotation.service;

import org.rana.example.annotation.entity.User;
import org.rana.example.annotation.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

/**
 * Class description:
 *
 * @author zhw
 * @version 1.0 16/9/26 上午9:16
 */
@Component
@Transactional
public class UserService {

    @Autowired
    UserMapper userMapper;


    public int insert(User user) {
        int id = userMapper.insert(user);
        return id;
    }

    public User selectById(int id) {
        return userMapper.selectById(id);
    }

}
